#ifndef FIGURECONTAINER_H
#define FIGURECONTAINER_H

#include <vector>
#include <string>
#include "figurecontainer_global.h"

enum typeFigure{circle, triangle, rectangle};
enum exceptionType{notReadOpen, notWriteOpen};
class FIGURECONTAINERSHARED_EXPORT Figure
{
public:
    Figure(){}
    virtual ~Figure(){}
    virtual void setCoord(std::vector<double> &data) = 0;
    virtual std::vector<double> getCoord() = 0;
    virtual std::pair<double, double> centrePoint() = 0;
    virtual void shift(double shiftX, double shiftY) = 0;
    virtual void rotation(double rotAngle) = 0;
    virtual void extansion(double extCoef) = 0;
    virtual typeFigure type() = 0;
    virtual std::string dataToString() = 0;

public:
    static Figure* makeFigure(typeFigure type, std::vector<double> &data);
};

class FIGURECONTAINERSHARED_EXPORT FigureContainer
{
public:
    FigureContainer();
    ~FigureContainer();
    void addFigure(Figure* fig);
    void removeFigure(int i);
    void writeFile(std::string fileName);
    void readFile(std::string fileName);
    Figure *operator[] (size_t i);
    size_t size();
    void clear();

private:
    std::vector<Figure*> container;
};

#endif // FIGURECONTAINER_H
